package com.ibeeking.found.content.c.rest.controller.v1.feign;

import com.ibeeking.found.content.c.rest.service.IBroadcastGroupService;
import com.ibeeking.found.content.c.rest.service.IBroadcastService;
import com.ibeeking.found.content.service.common.query.BroadcastGroupQuery;
import com.ibeeking.found.content.service.common.query.BroadcastQuery;
import com.ibeeking.found.content.service.common.vo.BroadcastCouponVO;
import com.ibeeking.found.content.service.common.vo.BroadcastGoodsVO;
import com.ibeeking.found.content.service.common.vo.BroadcastGroupVO;
import com.ibeeking.found.content.service.common.vo.BroadcastVO;
import com.ibeeking.nematos.constants.enums.OperateLogTypeEnum;
import com.ibeeking.nematos.log.annotation.Log;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName BroadcastFeignController控制器
 * @Description
 * @Author ibeeking
 * @Date 2022-02-18 14:11
 **/
@RestController
@RequestMapping("/c/broadcast/feign/v1")
public class BroadcastFeignController {

    @Resource
    private IBroadcastService broadcastServiceImpl;
    @Resource
    private IBroadcastGroupService broadcastGroupServiceImpl;

    @Log(logType = OperateLogTypeEnum.QUERY, describe = "直播间列表")
    @PostMapping(value = "/list")
    public List<BroadcastVO> list(@RequestBody BroadcastQuery broadcastQuery) {
        return broadcastServiceImpl.list(broadcastQuery);
    }
    @Log(logType = OperateLogTypeEnum.QUERY, describe = "直播间上架商品列表")
    @PostMapping(value = "/listOnsaledGoods")
    public List<BroadcastGoodsVO> listOnsaledGoods(@RequestBody BroadcastQuery broadcastQuery) {
        return broadcastServiceImpl.listOnsaledGoods(broadcastQuery);
    }

    @Log(logType = OperateLogTypeEnum.QUERY, describe = "直播间上架优惠券列表")
    @PostMapping(value = "/listOnsaledCoupon")
    public List<BroadcastCouponVO> listOnsaledCoupon(@RequestBody BroadcastQuery broadcastQuery) {
        return broadcastServiceImpl.listOnsaledCoupon(broadcastQuery);
    }

    @Log(logType = OperateLogTypeEnum.QUERY, describe = "直播间分组列表")
    @PostMapping(value = "/group/list")
    public List<BroadcastGroupVO> groupList(@RequestBody BroadcastGroupQuery broadcastGroupQuery) {
        return broadcastGroupServiceImpl.list(broadcastGroupQuery);
    }

}
